// components/shop-item/index.js
import {
    util,
    commonMixin
} from "../../utils/util.js";

Component({
    options: {
        addGlobalClass: true,
    },
    behaviors: [commonMixin],
    properties: {
        showCommentNum: {
            type: Boolean,
            value: true
        },
        item: {
            type: Object,
            value: {}
        },
    },
    observers: {
        item: function (data) {

        }
    },
    /**
     * 组件的初始数据
     */
    data: {

    },

    /**
     * 组件的方法列表
     */
    methods: {
        itemTap() {
            this.triggerEvent('ItemTap', this.data.item)
        },
        loopEwm() {
            wx.previewImage({
                current: this.data.item.qrcode,
                urls: [this.data.item.qrcode]
            })
        },
        openMapApp() {
            this.triggerEvent('openMapApp', this.data.item);
        },
        makePhoneCall() {
            wx.makePhoneCall({
                phoneNumber: this.data.item.telephone
            })
        }
    }
})